<?php
	$home_uid=$this->user['uid'];
	$childrenarr=$this->getRows("SELECT * FROM {$this->prename}members where parentId={$this->user['uid']} or zparentId={$this->user['uid']} or gudongId={$this->user['uid']} or uid=?",$home_uid);
	?>

<table width="100%" class='table_b'>
	<thead>
		<tr class="table_b_th">
			<th>用户名</th>
			<th>类型</th>
			<th>来源</th>
			<th>可用|冻结</th>
			<th>中奖|退水</th>
			<th>投注|盈亏</th>
			<th>返点(分成)</th>
			<th>状态</th>
			<th>最后登录</th>
		</tr>
	</thead>
	<tbody class="table_b_tr">
	<?php 
		$onlineNum = 0;
		foreach($childrenarr as $var){
			$login=$this->getRow("select * from {$this->prename}member_session where uid=? order by id desc limit 1", $var['uid']);
		if($login['isOnLine'] && ($this->time-$login['accessTime']<900)){
			$parents = explode(',',$var['parents']);
			rsort($parents);
			$index = 1;
			foreach($parents as $key=>$var2){
				$index++;
			}
	?>
		<tr>
			<td><?=$var['username']; ?></td>
			<td><?php if($var['type']==1){echo'代理';}elseif($var['type']==2){echo'总代理';}elseif($var['type']==3){echo'股东';}
				else{echo '会员';}?>
				<?php if($var['panid']==2){
					echo '(B盘)';
				}elseif ($var['panid']==3){
					echo '(C盘)';
				}elseif ($var['panid']==4){
					echo '(D盘)';
				}elseif ($var['panid']==5){
					echo '(E盘)';
				}else{
					echo '(A盘)';
				}

				?></td>
			<?php
			$idxx = explode(':', $var['src']);
			if(count($idxx)==2){
				?>
				<td><?=$idxx[0]?>|<?=$idxx[1]?></td>
			<?php }else{ ?>
				<td><?=$this->iff($var['src']=="",'--', $var['src'])?></td>
			<?php } ?>
			<td><?=$var['coin']?><span class='spn10'>|</span><?=$var['fcoin']?></td>

			<td><?=$this->ifs($var['zjAmount'], '--')?><span class='spn10'>|</span><?=$var['rebateMoneyDouble']?></td>
			<td><?=$this->ifs($var['betAmount'], '--')?><span class='spn10'>|</span><?=$this->ifs($var['zjAmount']-$var['betAmount']+$var['rebateMoneyDouble'], '--')?></td>
			<td><?=$var['fanDian']?>%</td>
			<td><?=$this->iff($login['isOnLine'] && ceil(strtotime(date('Y-m-d H:i:s', time()))-strtotime(date('Y-m-d H:i:s',$login['accessTime'])))<$GLOBALS['conf']['member']['sessionTime'], '<font color="#FF0000">在线</font>', '离线')?></td>
			<td><?=$this->iff($login['loginTime'],date('m-d H:i', $login['loginTime']),'--')?></td>

		</tr>
	<?php 
		$onlineNum++;
		} } 
	?>
	<tr><td colspan="9" align="left">在线总数：<?=$onlineNum?></td></tr>
	</tbody>
</table>
